<?php

namespace App\Http\Controllers\Stats\User;

use Helper\Timed;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Resources\Common\DatasResource;
use App\Services\Stats\User\RetentionService;

/**
 * 统计-玩家留存
 */
class RetentionController extends Controller
{
	public function __construct()
	{
	}

    /**
     * 数据列表【游戏留存】
     */
    public function game(Request $request)
    {
	    Timed::setForceNotAbs();

	    list ($collection, $total) = RetentionService::create()->game($request);

        return DatasResource::make($collection)->setPaginateTotal($total);
    }

    /**
     * 数据列表【注册留存】
     */
    public function sign(Request $request)
    {

	    list ($collection, $total) = RetentionService::make()->sign($request);

        return DatasResource::make($collection)->setPaginateTotal($total);
    }
}
